<script>
    import TimeSpinner from "view-design/src/components/date-picker/base/time-spinner";

    const timeParts = ['hours', 'minutes', 'seconds'];

    export default {
        extends: TimeSpinner,

        methods: {
            updateScroll () {
                this.$nextTick(() => {
                    timeParts.forEach(type => {
                        const index = this[`${type}List`].findIndex(obj => obj.text === this[type]);

                        this.$refs[type].scrollTop = 24 * this.getScrollIndex(type, index);
                    });
                });
            },
        }
    }
</script>